#ifndef INC_MOLECULE_READER_H
#define INC_MOLECULE_READER_H

#include <map>
#include <string>

#include "../model/Molecule_Visitor.h"

class Atom_Element;
class PDB_Types_Adapter;
class Molecule;

/**
 * FDMDE molecule factory. Creates a molecule from a PDB.
 * TODO: Should this class exists? It's a little bit anemic as it is, but we
 * can't move the responsibility of reading from a PDB to a moleclue (plus having
 * a dependency to IO from the module Model is highly unwanted) and we can't move
 * the responsibility of creating a molecule to a PDB_Types_Adapter (the scope of
 * the object would be too big)
 */
class MoleculeReader : Molecule_Visitor
{
    Molecule* molecule;

    void on_atom_found(const Atom* atom, const Atom_Element* type);
    void on_fragment_start();

public:
    /**
     * Read all the atoms available from a PDB file into a molecule
     */
    void read(PDB_Types_Adapter& pdb, Molecule* molecule);
};

#endif /* INC_MOLECULE_READER_H */
